package com.ruoyi.project.sysmanage.service.impl;

import com.ruoyi.project.sysmanage.domain.Registration;
import com.ruoyi.project.sysmanage.mapper.RegistrationMapper;
import com.ruoyi.project.sysmanage.service.RegistrationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * @author : 代学欣
 * @date : 20:42 2021/7/14
 */
@Service
public class RegistrationServiceImpl implements RegistrationService {
    @Autowired
    private RegistrationMapper registrationMapper;

    @Override
    public List<Registration> selectList(Registration registration) {
        return registrationMapper.selectList(registration);
    }

    @Override
    public int addRegistration(Registration registration) {
        registration.setCreateTime(new Date());
        return registrationMapper.insert(registration);
    }

    @Override
    public Registration getById(Integer reg_id) {
        return registrationMapper.selectById(reg_id);
    }

    @Override
    public int updateRegistration(Registration registration) {
        registration.setUpdateTime(new Date());
        return registrationMapper.update(registration);
    }

    @Override
    public int deleteRegistration(Integer[] reg_ids) {
        return registrationMapper.batchdelete(reg_ids);
    }
}
